package com.sservice.model.common;


import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

public class CustomSqlSessionFactoryBean extends SqlSessionFactoryBean {

    private Logger logger = LoggerFactory.getLogger(CustomSqlSessionFactoryBean.class);

    @Override
    protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
        try {
            return super.buildSqlSessionFactory();
        } catch (Exception e) {
            logger.error("[==SSERVICE==]mybatis mapper file error: " + e.getMessage());
            throw new MybatisMapperException("[==SSERVICE==]mybatis mapper file error !"+e.getStackTrace());
        }
    }
}
